//
// File    : MultipleChoiceQuestion.cs
// Author  : Dylan Gleason
// Class   : CST 336 - Junior Project
// Team    : Axial Computing, Inc.
// Project : Uncle Bob
//
// MultipleChoiceQuestion inherits ApplicationQuestion's interface and
// represents a multiple choice question that appears in the wizard.
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Web;

namespace UncleBobWebService.Models
{
    [DataContract]  
    public class MultipleChoiceQuestion : ApplicationQuestion
    {
        // constructor
        public MultipleChoiceQuestion()
        {
            InitDictionary();
        }

        // overloaded constructor
        public MultipleChoiceQuestion(string question)
        {
            Question = question;
            InitDictionary();
        }

        //
        // All possible answers for the given question - but only
        // one of which is correct.
        //
        [DataMember]
        public SortedDictionary<int, Answer> PossibleAnswers
        {
            get;
            private set;
        }

        // Add an answer to the Dictionary of PossibleAnswers
        public void AddPossibleAnswer(Answer answer)
        {
            PossibleAnswers.Add(PossibleAnswers.Count, answer);
        }



        // Initialize the Dictionary upon object instantiation
        private void InitDictionary()
        {
            PossibleAnswers = new SortedDictionary<int, Answer>();
        }
    }
}

